package geguol.cc.widgetapplication.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;

import geguol.cc.widgetapplication.R;
import geguol.cc.widgetapplication.bean.TestBean;
import geguol.cc.widgetapplication.widget.SearchDropListView;

public class SearchActivity extends AppCompatActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_search);
		final SearchDropListView searchView = (SearchDropListView) findViewById(R.id.text_id);
		searchView.dimBackground(this);
		searchView.setRequestInterface(new SearchDropListView.RequestInterface<TestBean>() {
			@Override
			public void onRequest(String keywords) {
				List<TestBean> list = new ArrayList<TestBean>();
				for (int i = 0; i < 6; i++) {
					TestBean testBean = new TestBean(i,i+"."+keywords);
					list.add(testBean);
				}
				searchView.showResult(list);

			}

			@Override
			public void onResponse(TestBean testBean) {
				System.out.println("去选择地图："+testBean.getText());
			}
		});
	}
}
